<template>
    <div class="box">
        <ul>  
            <li v-for="(shuzus,index) in shuzu" :key="index" @click="add(index)">
                <img :src="shuzus.typePic">
                <span>{{shuzus.typeName}}</span> 
            </li>    
        </ul>
        <div class="new"><img src="../assets/sf12.jpg"></div>
        <div class="eight"><img src="../assets/sf11.jpg"></div>
    </div>
</template>
<script>
import axios from "axios"
export default {
    data(){
        return {
            shuzu:[]
        }
    },
    created(){
        axios({
            url:"/api/goods/findFashionType"
        })
        .then(res=>{
            this.shuzu=res.data.data
        })
    },
    methods:{
        add(index){
            if (index==0) {
            this.$router.push('/Xinpin')
            }
            if(index==9){
                this.$router.push('Chaowan')
            }
        }
    }
}
</script>
<style scoped>
    .box{
        width: 3.40rem;
        height: 1.73rem;
        margin-left: 10px;
        background-color: #fff;
        border-radius: 4px;
        margin-top: 0.1rem;
        overflow: hidden;
        position: relative;
    }
    ul{
        width: 3.2rem;
        height: 1.5rem;
        margin: auto;
        margin-top: 0.12rem;
        display: flex;
        flex-wrap: wrap; 
    }
    ul li{
        width: 0.5rem;
        height: 0.66rem;
        font-size: 0.12rem;
        margin-left: 0.06rem;
        margin-right: 0.06rem;
        margin-top: 0.14rem;
        display: flex;
        flex-wrap: wrap;
        align-content: space-between;
    }
    ul li img{
        display: block;
        margin: auto;
    }
    ul li span{
        display: block;
    }
    .new{
        position: absolute;
        top: 0.1rem;
        left: 0.1rem;
    }
    .eight{
        position: absolute;
        top: 50%;
        left: 40%;
    }
</style>
